﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestApp
{
    public class MyGenericList<T>
    {
        T[] innerList;

        public int Count
        {
            get
            {
                if (innerList != null)
                {
                    return innerList.Length;
                }

                return 0;
            }
        }


        public MyGenericList()
        {
            innerList = new T[Count];
        }
        public void Add(T t)
        {
            var tempList = new T[Count + 1];

            Array.Copy(innerList, tempList, Count);

            tempList[Count] = t;

            innerList = tempList;
        }
        public void RemoveAt(int index)
        {
            var tempList = new T[Count - 1];
            int j = 0;

            for (int i = 0; i < tempList.Length; i++)
            {
                if (i == index)
                    j++;

                tempList[i] = innerList[j];
                j++;
            }

            innerList = tempList;
        }
    }
}
